import { ApiProperty } from "@nestjs/swagger";
import { IsEmail, IsNotEmpty } from "class-validator";

/*
 * @Description: 
 * @Author: fhw
 * @Date: 2022-12-03 16:47:59
 */
export class SendMailDto {
    @IsNotEmpty({ message: '名称不能为空' })
    @ApiProperty({
        type: String,
        name: 'name',
        description: '名称',
    })
    public readonly name: string
    
    @IsEmail()
    @IsNotEmpty({ message: '发送人邮件地址不能为空' })
    @ApiProperty({
        type: String,
        name: 'sendEmail',
        description: '发送人邮件地址',
    })
    public readonly sendEmail: string

    @IsNotEmpty({ message: '内容不能为空' })
    @ApiProperty({
        type: String,
        name: 'message',
        description: '内容',
    })
    public readonly message: string
}